package com.threeti.mecool.core.domain.model.client;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.threeti.mecool.framework.domain.support.DefaultDomainEntity;

/**
 * Android手机端APK包的相关信息<p/>
 * 
 * 1.记录Android手机端APK包发布的历史记录<br/>
 * 2.记录Android手机端APK包发布的版本和相关摘要描述
 * 
 * @author Jay Meng
 */
@Entity
@Table(name = "DM_ANDROID_APK")
public class AndroidApk extends DefaultDomainEntity {
  
  @Column(name="APK_VERSION", unique=true)
  private int version;
  
  @Column(nullable=false)
  private String url;
  
  @Column(name="APK_DESC")
  private String desc;
  
  private Date createAt = new Date();

  public AndroidApk(int version, String url, String desc, Date createAt) {
    super();
    this.version = version;
    this.url = url;
    this.desc = desc;
    this.createAt = createAt;
  }

  /** 取得APK的版本号 */
  public int getVersion() {
    return version;
  }

  /** 取得APK包的下载路径  */
  public String getUrl() {
    return url;
  }

  /** 取得APK包的相关描述信息(如Release Note等)  */
  public String getDesc() {
    return desc;
  }

  /** 取得APK包的创建时间  */
  public Date getCreateAt() {
    return createAt;
  }

  @Override
  public String toString() {
    return "AndroidApk [version=" + version + ", url=" + url + ", desc=" + desc + ", createAt=" + createAt + "]";
  }

  public AndroidApk() {
    super();
  }
  
}
